package pack423;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class WriteText {
    public static void main(String[] args) {
        BufferedWriter bw = null;
        try {
            bw = new BufferedWriter(new FileWriter("document/test.txt"));
            bw.write("刘磊是世界上最漂亮的女人");
            bw.newLine();
            bw.write("刘磊不仅人漂亮，还很水嫩");
            bw.newLine();
            bw.write("我坚持认为刘磊是最美的女人，因为各个女人都没有刘磊漂亮");
            bw.newLine();
            bw.flush();
            System.out.println("成功的将存档中的数据写到test.txt文件中去了");
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                bw.close();
                bw = null;
            } catch (IOException e) {
                e.printStackTrace();
            }

        }
    }
}
